package yt.demo.appcorequartz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum JobType {
    COMMAND(1, "命令任务"),
    CLASS(2, "类任务"),
    URL(3, "URL任务");

    private final int type;
    private final String typeName;

    public static JobType fromType(int type) {
        for (JobType jobType : JobType.values()) {
            if (jobType.getType() == type) {
                return jobType;
            }
        }
        return null;
    }
}
